package com.wyz.saas.common.set

abstract class AbstractAppSetDescriptorInt : AbstractAppSetDescriptor<Int>() {

    abstract fun max(): Int
    abstract fun min(): Int
    override fun default(): Int {
        return 0
    }

    override fun validate(value: Any?): Boolean {
        if (value != null) {
            if (value is String) {
                try {
                    value.toInt()
                    return true
                } catch (e: NumberFormatException) {

                }
            } else if (value is Int) {
                return true
            }
        }
        return false
    }
}